using System;
using System.IO;
using System.Web.Caching;
using BoxBinary.AspectCache.Core.CacheManagement;

namespace BoxBinary.AspectCache.Core.PolicyDefinition
{
    [Serializable]
    public class WebPolicyBoundCachePackage : PolicyBoundCachePackage

    {
        public WebPolicyBoundCachePackage(ICacheable objectToCache) : base(objectToCache)
        {
        }

        public WebPolicyBoundCachePackage(ICacheable objectToCache, CacheItemFootprint footprintFlags)
            : base(objectToCache, footprintFlags)
        {
        }

        public CacheDependency GetFileDependency()
        {
            CacheDependency cDependency = null;
            if (!string.IsNullOrEmpty(CacheDependencyPath))
            {
                if (File.Exists(CacheDependencyPath))
                    cDependency = new CacheDependency(CacheDependencyPath);
            }
            return cDependency;
        }
    }
}